home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / maqlnf30 / sample.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1999-02-20  |  18.6 KB  |  566 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.1#0"; "COMDLG32.OCX"
  3. Object = "{6B7E6392-850A-101B-AFC0-4210102A8DA7}#1.2#0"; "COMCTL32.OCX"
  4. Object = "{DCAB1B27-C8E6-11D2-AC40-00C0DFE9A30F}#3.0#0"; "BWZIPVB5B4.OCX"
  5. Begin VB.Form Form1 
  6.    Caption         =   "BW Zip Compress OCX 3.0.0 - Beta 4"
  7.    ClientHeight    =   6240
  8.    ClientLeft      =   165
  9.    ClientTop       =   450
  10.    ClientWidth     =   9120
  11.    LinkTopic       =   "Form1"
  12.    LockControls    =   -1  'True
  13.    ScaleHeight     =   6240
  14.    ScaleWidth      =   9120
  15.    StartUpPosition =   2  'CenterScreen
  16.    Begin BWZipCompress300.MaqZip MaqZip1 
  17.       Left            =   8040
  18.       Top             =   720
  19.       _ExtentX        =   1058
  20.       _ExtentY        =   1058
  21.    End
  22.    Begin VB.CommandButton Command10 
  23.       Caption         =   "Get Status"
  24.       Height          =   495
  25.       Left            =   6480
  26.       TabIndex        =   39
  27.       Top             =   1440
  28.       Width           =   1455
  29.    End
  30.    Begin VB.CommandButton Command9 
  31.       Caption         =   "Cancel operation"
  32.       Height          =   375
  33.       Left            =   3240
  34.       TabIndex        =   38
  35.       ToolTipText     =   "This will cancel the compression or decompression"
  36.       Top             =   1800
  37.       Width           =   2175
  38.    End
  39.    Begin ComctlLib.ProgressBar ProgressBar1 
  40.       Height          =   135
  41.       Left            =   120
  42.       TabIndex        =   37
  43.       Top             =   6000
  44.       Width           =   8895
  45.       _ExtentX        =   15690
  46.       _ExtentY        =   238
  47.       _Version        =   327682
  48.       Appearance      =   1
  49.    End
  50.    Begin ComctlLib.ListView ListView1 
  51.       Height          =   1455
  52.       Left            =   120
  53.       TabIndex        =   36
  54.       ToolTipText     =   "Click to select the file to uncompress"
  55.       Top             =   4440
  56.       Width           =   8895
  57.       _ExtentX        =   15690
  58.       _ExtentY        =   2566
  59.       LabelWrap       =   -1  'True
  60.       HideSelection   =   -1  'True
  61.       _Version        =   327682
  62.       ForeColor       =   -2147483640
  63.       BackColor       =   -2147483643
  64.       BorderStyle     =   1
  65.       Appearance      =   1
  66.       NumItems        =   0
  67.    End
  68.    Begin MSComDlg.CommonDialog CommonDialog1 
  69.       Left            =   3240
  70.       Top             =   1200
  71.       _ExtentX        =   847
  72.       _ExtentY        =   847
  73.       _Version        =   327681
  74.    End
  75.    Begin VB.TextBox Text9 
  76.       Height          =   285
  77.       Left            =   120
  78.       TabIndex        =   32
  79.       Text            =   "*.*"
  80.       Top             =   2880
  81.       Width           =   3015
  82.    End
  83.    Begin VB.CommandButton Command8 
  84.       Caption         =   "Get Zip file information"
  85.       Height          =   375
  86.       Left            =   7200
  87.       TabIndex        =   25
  88.       Top             =   2640
  89.       Width           =   1815
  90.    End
  91.    Begin VB.CommandButton Command7 
  92.       Caption         =   "Maximum"
  93.       Height          =   230
  94.       Left            =   4800
  95.       TabIndex        =   24
  96.       Top             =   720
  97.       Width           =   1455
  98.    End
  99.    Begin VB.CommandButton Command6 
  100.       Caption         =   "Normal"
  101.       Height          =   230
  102.       Left            =   4800
  103.       TabIndex        =   23
  104.       Top             =   1200
  105.       Width           =   1455
  106.    End
  107.    Begin VB.CommandButton Command5 
  108.       Caption         =   "Minimum"
  109.       Height          =   230
  110.       Left            =   4800
  111.       TabIndex        =   22
  112.       Top             =   1440
  113.       Width           =   1455
  114.    End
  115.    Begin VB.CommandButton Command4 
  116.       Caption         =   "High"
  117.       Height          =   230
  118.       Left            =   4800
  119.       TabIndex        =   21
  120.       Top             =   960
  121.       Width           =   1455
  122.    End
  123.    Begin VB.CommandButton Command3 
  124.       Caption         =   "Browse/List"
  125.       Height          =   375
  126.       Left            =   3240
  127.       TabIndex        =   18
  128.       Top             =   2280
  129.       Width           =   1215
  130.    End
  131.    Begin VB.TextBox Text8 
  132.       Height          =   285
  133.       Left            =   120
  134.       TabIndex        =   17
  135.       Top             =   840
  136.       Width           =   3015
  137.    End
  138.    Begin VB.TextBox Text7 
  139.       Height          =   285
  140.       Left            =   120
  141.       TabIndex        =   15
  142.       Text            =   "-o"
  143.       Top             =   3480
  144.       Width           =   3015
  145.    End
  146.    Begin VB.TextBox Text6 
  147.       Height          =   285
  148.       Left            =   5520
  149.       TabIndex        =   14
  150.       Top             =   2280
  151.       Width           =   2415
  152.    End
  153.    Begin VB.TextBox Text5 
  154.       Height          =   285
  155.       Left            =   120
  156.       TabIndex        =   13
  157.       Top             =   2280
  158.       Width           =   3015
  159.    End
  160.    Begin VB.TextBox Text4 
  161.       Height          =   285
  162.       Left            =   120
  163.       TabIndex        =   12
  164.       Top             =   1440
  165.       Width           =   3015
  166.    End
  167.    Begin VB.TextBox Text3 
  168.       Height          =   285
  169.       Left            =   6480
  170.       TabIndex        =   7
  171.       Top             =   240
  172.       Width           =   2535
  173.    End
  174.    Begin VB.TextBox Text2 
  175.       Height          =   285
  176.       Left            =   3600
  177.       TabIndex        =   3
  178.       Top             =   240
  179.       Width           =   2655
  180.    End
  181.    Begin VB.TextBox Text1 
  182.       Height          =   285
  183.       Left            =   120
  184.       TabIndex        =   2
  185.       Top             =   240
  186.       Width           =   3015
  187.    End
  188.    Begin VB.CommandButton Command2 
  189.       Caption         =   "Decompress"
  190.       Height          =   375
  191.       Left            =   5520
  192.       TabIndex        =   1
  193.       Top             =   2640
  194.       Width           =   1575
  195.    End
  196.    Begin VB.CommandButton Command1 
  197.       Caption         =   "Compress"
  198.       Height          =   495
  199.       Left            =   6480
  200.       TabIndex        =   0
  201.       Top             =   720
  202.       Width           =   1455
  203.    End
  204.    Begin VB.Label Label19 
  205.       Height          =   615
  206.       Left            =   5280
  207.       TabIndex        =   35
  208.       Top             =   3480
  209.       Width           =   3735
  210.    End
  211.    Begin VB.Label Label18 
  212.       Caption         =   "System error code returned :"
  213.       Height          =   255
  214.       Left            =   3240
  215.       TabIndex        =   34
  216.       Top             =   3480
  217.       Width           =   2055
  218.    End
  219.    Begin VB.Label Label17 
  220.       Height          =   255
  221.       Left            =   3360
  222.       TabIndex        =   33
  223.       Top             =   1200
  224.       Width           =   1335
  225.    End
  226.    Begin VB.Label Label16 
  227.       Caption         =   "Select the Zip entries to uncompress"
  228.       Height          =   255
  229.       Left            =   120
  230.       TabIndex        =   31
  231.       Top             =   2640
  232.       Width           =   2895
  233.    End
  234.    Begin VB.Label Label15 
  235.       Caption         =   "This section will list the files in the Zip file"
  236.       Height          =   255
  237.       Left            =   120
  238.       TabIndex        =   30
  239.       Top             =   3840
  240.       Width           =   7815
  241.    End
  242.    Begin VB.Label Label14 
  243.       Caption         =   "Select the processor usage of the OCX"
  244.       Height          =   495
  245.       Left            =   3240
  246.       TabIndex        =   29
  247.       Top             =   600
  248.       Width           =   1455
  249.    End
  250.    Begin VB.Label Label13 
  251.       Height          =   255
  252.       Left            =   5520
  253.       TabIndex        =   28
  254.       Top             =   4080
  255.       Width           =   2535
  256.    End
  257.    Begin VB.Label Label12 
  258.       Height          =   255
  259.       Left            =   2760
  260.       TabIndex        =   27
  261.       Top             =   4080
  262.       Width           =   2655
  263.    End
  264.    Begin VB.Label Label11 
  265.       Height          =   255
  266.       Left            =   120
  267.       TabIndex        =   26
  268.       Top             =   4080
  269.       Width           =   2415
  270.    End
  271.    Begin VB.Label Label10 
  272.       Height          =   375
  273.       Left            =   4800
  274.       TabIndex        =   20
  275.       Top             =   3120
  276.       Width           =   4215
  277.    End
  278.    Begin VB.Label Label9 
  279.       Caption         =   "Error code returned : "
  280.       Height          =   255
  281.       Left            =   3240
  282.       TabIndex        =   19
  283.       Top             =   3120
  284.       Width           =   1455
  285.    End
  286.    Begin VB.Label Label8 
  287.       Caption         =   "Select the path of the files to compress"
  288.       Height          =   255
  289.       Left            =   120
  290.       TabIndex        =   16
  291.       Top             =   0
  292.       Width           =   2895
  293.    End
  294.    Begin VB.Label Label7 
  295.       Caption         =   "Select the destination file"
  296.       Height          =   255
  297.       Left            =   6480
  298.       TabIndex        =   11
  299.       Top             =   0
  300.       Width           =   2295
  301.    End
  302.    Begin VB.Label Label6 
  303.       Caption         =   "Select the options to decompress"
  304.       Height          =   255
  305.       Left            =   120
  306.       TabIndex        =   10
  307.       Top             =   3240
  308.       Width           =   3135
  309.    End
  310.    Begin VB.Label Label5 
  311.       Caption         =   "Select the path to the decompressed files"
  312.       Height          =   255
  313.       Left            =   5520
  314.       TabIndex        =   9
  315.       Top             =   2040
  316.       Width           =   3015
  317.    End
  318.    Begin VB.Label Label4 
  319.       Caption         =   "Select the file to decompress"
  320.       Height          =   255
  321.       Left            =   120
  322.       TabIndex        =   8
  323.       Top             =   2040
  324.       Width           =   3255
  325.    End
  326.    Begin VB.Label Label3 
  327.       Caption         =   "Select the options to compress"
  328.       Height          =   255
  329.       Left            =   120
  330.       TabIndex        =   6
  331.       Top             =   1200
  332.       Width           =   3135
  333.    End
  334.    Begin VB.Label Label2 
  335.       Caption         =   "Select the destination path"
  336.       Height          =   255
  337.       Left            =   3600
  338.       TabIndex        =   5
  339.       Top             =   0
  340.       Width           =   2295
  341.    End
  342.    Begin VB.Label Label1 
  343.       Caption         =   "Select the files to compress"
  344.       Height          =   255
  345.       Left            =   120
  346.       TabIndex        =   4
  347.       Top             =   600
  348.       Width           =   2535
  349.    End
  350.    Begin VB.Menu compression 
  351.       Caption         =   "Compression Options"
  352.       Begin VB.Menu fix 
  353.          Caption         =   "Fix damaged Zip file"
  354.       End
  355.       Begin VB.Menu fix2 
  356.          Caption         =   "Force the fix of damaged Zip file"
  357.       End
  358.       Begin VB.Menu include 
  359.          Caption         =   "Include  system  and  hidden  files"
  360.       End
  361.       Begin VB.Menu option4 
  362.          Caption         =   "Compress files with best compression"
  363.       End
  364.       Begin VB.Menu option5 
  365.          Caption         =   "Compress files with fastest compression"
  366.       End
  367.       Begin VB.Menu option6 
  368.          Caption         =   "Store files - dont compress"
  369.       End
  370.       Begin VB.Menu option2 
  371.          Caption         =   "Delete files in Zip"
  372.       End
  373.       Begin VB.Menu option1 
  374.          Caption         =   "Compress folders and subfolders"
  375.       End
  376.    End
  377.    Begin VB.Menu decompression 
  378.       Caption         =   "Decompression Options"
  379.       Begin VB.Menu option9 
  380.          Caption         =   "Test Zip integrity - verify files in Zip"
  381.       End
  382.       Begin VB.Menu option8 
  383.          Caption         =   "Decompress files and junk pathnames - and always overwrite"
  384.       End
  385.       Begin VB.Menu option7 
  386.          Caption         =   "Decompress files and always overwrite if existing"
  387.       End
  388.    End
  389.    Begin VB.Menu about 
  390.       Caption         =   "About"
  391.    End
  392. Attribute VB_Name = "Form1"
  393. Attribute VB_GlobalNameSpace = False
  394. Attribute VB_Creatable = False
  395. Attribute VB_PredeclaredId = True
  396. Attribute VB_Exposed = False
  397. Private Sub about_Click()
  398. MaqZip1.AboutBox
  399. End Sub
  400. Private Sub Command1_Click()
  401. Form1.Caption = "Working..."
  402. Screen.MousePointer = vbArrowHourglass
  403. ric = MaqZip1.ZipCompress(Text1.Text, Text8.Text, Text2.Text, Text3.Text, Text4.Text)
  404. Screen.MousePointer = vbNormal
  405. End Sub
  406. Private Sub Command10_Click()
  407. MsgBox MaqZip1.Status
  408. End Sub
  409. Private Sub Command2_Click()
  410. Form1.Caption = "Working..."
  411. Screen.MousePointer = vbArrowHourglass
  412. MaqZip1.ZipUncompress Text5.Text, Text9.Text, Text6.Text, Text7.Text
  413. Screen.MousePointer = vbNormal
  414. End Sub
  415. Private Sub Command3_Click()
  416. CommonDialog1.ShowOpen
  417. If CommonDialog1.Filename = "" Then Exit Sub
  418. Text5.Text = CommonDialog1.Filename
  419. ListView1.ListItems.Clear
  420. Label11.Caption = ""
  421. Label12.Caption = ""
  422. Label13.Caption = ""
  423. If Dir(CommonDialog1.Filename) = "" Then Exit Sub 'verification of the file
  424. If MaqZip1.GetZipInfo(CommonDialog1.Filename) Then
  425. Label11.Caption = "Number of files :  " & MaqZip1.NumberOfFiles
  426. Label12.Caption = "Total compressed size : " & MaqZip1.TotalCompressedSize
  427. Label13.Caption = "Total uncompressed size : " & MaqZip1.TotalUncompressedSize
  428. End If
  429. End Sub
  430. Private Sub Command4_Click()
  431. MaqZip1.CPUBoost = BWHigh
  432. Label17.Caption = "High"
  433. End Sub
  434. Private Sub Command5_Click()
  435. MaqZip1.CPUBoost = BWMinimum
  436. Label17.Caption = "Minimum"
  437. End Sub
  438. Private Sub Command6_Click()
  439. MaqZip1.CPUBoost = BWNormal
  440. Label17.Caption = "Normal "
  441. End Sub
  442. Private Sub Command7_Click()
  443. MaqZip1.CPUBoost = BWMaximum
  444. Label17.Caption = "Maximum"
  445. End Sub
  446. Private Sub Command8_Click()
  447. ListView1.ListItems.Clear
  448. Label11.Caption = ""
  449. Label12.Caption = ""
  450. Label13.Caption = ""
  451. CommonDialog1.ShowOpen
  452. If Dir(CommonDialog1.Filename) = "" Then Exit Sub 'verification of the file
  453. If MaqZip1.GetZipInfo(CommonDialog1.Filename) Then
  454. Label11.Caption = "Number of files :  " & MaqZip1.NumberOfFiles
  455. Label12.Caption = "Total compressed size : " & MaqZip1.TotalCompressedSize
  456. Label13.Caption = "Total uncompressed size : " & MaqZip1.TotalUncompressedSize
  457. End If
  458. End Sub
  459. Private Sub Command9_Click()
  460. MaqZip1.CancelOperation
  461. End Sub
  462. Private Sub fix_Click()
  463. Text4.Text = "-F"
  464. End Sub
  465. Private Sub fix2_Click()
  466. Text4.Text = "-FF"
  467. End Sub
  468. Private Sub Form_Activate()
  469. Dim clmX As ColumnHeader
  470.     Set clmX = ListView1.ColumnHeaders. _
  471.     Add(, , "Filename", ListView1.Width / 3)
  472. Set clmX = ListView1.ColumnHeaders. _
  473.     Add(, , "Date        Time", ListView1.Width / 4)
  474.     Set clmX = ListView1.ColumnHeaders. _
  475.     Add(, , "CRC-32", ListView1.Width / 10)
  476.     Set clmX = ListView1.ColumnHeaders. _
  477.     Add(, , "Signature", ListView1.Width / 10)
  478.     Set clmX = ListView1.ColumnHeaders. _
  479.     Add(, , "Version", ListView1.Width / 15)
  480.     Set clmX = ListView1.ColumnHeaders. _
  481.     Add(, , "Compressed", ListView1.Width / 7)
  482.     Set clmX = ListView1.ColumnHeaders. _
  483.     Add(, , "Uncompressed", ListView1.Width / 7)
  484.     Set clmX = ListView1.ColumnHeaders. _
  485.     Add(, , "Ratio", ListView1.Width / 18)
  486.     Set clmX = ListView1.ColumnHeaders. _
  487.     Add(, , "Compression Type", ListView1.Width / 5)
  488. ListView1.View = lvwReport
  489. End Sub
  490. Private Sub Form_Load()
  491. ProgressBar1.Min = 0
  492. ProgressBar1.Max = 100
  493. End Sub
  494. Private Sub include_Click()
  495. Text4.Text = "-S"
  496. End Sub
  497. Private Sub ListView1_ItemClick(ByVal Item As ComctlLib.ListItem)
  498. Text9.Text = Item
  499. End Sub
  500. Private Sub MaqZip1_CreatingDir()
  501. Form1.Caption = Form1.Caption & " Directory created"
  502. End Sub
  503. Private Sub MaqZip1_Errorcode(Errorcode As Long, Errordescription As String)
  504. Label10.Caption = Errordescription
  505. Form1.Caption = Finished
  506. End Sub
  507. Private Sub MaqZip1_Finished()
  508. Form1.Caption = "Finished"
  509. End Sub
  510. Private Sub MaqZip1_Progress(Position As Long)
  511. ProgressBar1.Value = Position
  512. End Sub
  513. Private Sub MaqZip1_SystemErrorCode(Errorcode As Long, Description As String)
  514. Label19.Caption = Errorcode & "  :  " & Description
  515. End Sub
  516. Private Sub MaqZip1_ZipFileInformation(Filename As String, ZipDay As Long, ZipMonth As Long, ZipYear As Long, ZipHour As Long, ZipMinute As Long, ZipSecond As Long, ZipCRC32 As String, ZipSignature As Long, ZipVersion As Long, ZipCompressedSize As Long, ZipUncompressedSize As Long, ZipRatio As Long, ZipCompressionType As Long)
  517. Set minhalista = ListView1.ListItems.Add(1, , Filename)
  518. ListView1.ListItems.Item(1).SubItems(1) = ZipDay & "/" & ZipMonth & "/" & ZipYear & "  " & ZipHour & ":" & ZipMinute & ":" & ZipSecond 'this will format the values
  519. ListView1.ListItems.Item(1).SubItems(2) = ZipCRC32
  520. ListView1.ListItems.Item(1).SubItems(3) = ZipSignature
  521. ListView1.ListItems.Item(1).SubItems(4) = ZipVersion
  522. ListView1.ListItems.Item(1).SubItems(5) = ZipCompressedSize
  523. ListView1.ListItems.Item(1).SubItems(6) = ZipUncompressedSize
  524. ListView1.ListItems.Item(1).SubItems(7) = ZipRatio & "%"        'this will add the percentage simbol to the value
  525. Select Case ZipCompressionType
  526. Case 1
  527. ListView1.ListItems.Item(1).SubItems(8) = "None"
  528. Case 2
  529. ListView1.ListItems.Item(1).SubItems(8) = "Super Fast"
  530. Case 3
  531. ListView1.ListItems.Item(1).SubItems(8) = "Fast"
  532. Case 4
  533. ListView1.ListItems.Item(1).SubItems(8) = "Normal"
  534. Case 5
  535. ListView1.ListItems.Item(1).SubItems(8) = "Maximum"
  536. End Select
  537. End Sub
  538. Private Sub option1_Click()
  539. Text4.Text = "-R"
  540. End Sub
  541. Private Sub option2_Click()
  542. Text4.Text = "-d"
  543. MsgBox "Select what files in the Zip you want to delete , and you can use wildcards like this -> *.txt  *.exe  *.* "
  544. Text8.Text = "*.*"
  545. End Sub
  546. Private Sub option4_Click()
  547. Text4.Text = "-9"
  548. End Sub
  549. Private Sub option5_Click()
  550. Text4.Text = "-1"
  551. End Sub
  552. Private Sub option6_Click()
  553. Text4.Text = "-0"
  554. End Sub
  555. Private Sub option7_Click()
  556. Text7.Text = "-o"
  557. End Sub
  558. Private Sub option8_Click()
  559. Text7.Text = "-o -j"
  560. End Sub
  561. Private Sub option9_Click()
  562. Text7.Text = "-t"
  563. MsgBox "The option to be inserted in decompression is  '-t' " & vbCrLf & _
  564. "The errorcode will return the state of the Zip file , if it returns 0 or 1 , then the Zip file is ok , any different value will represent a bad Zip file , and you need to select what entry in Zip you want to test , insert an '*.*' to test all entries and the entire Zip file also or '*.txt' to test any txt file in the Zip ,  and the possibility of errors in this detection is very low , in our tests a unique single byte different in any place of the file can be detected by this verification despite the possibility to the file be decompressed  by the Infozip or Winzip method without errors  , to make the test we are using the normal Zip error detection and a new method of Zip error detection developed originally by BinaryWork Corp."
  565. End Sub
  566.